package com.gt.xmall.model;

import javax.persistence.*;

import java.io.Serializable;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;


@Entity
@Table(name = "gtd_topic")
public class GtdTopic extends IdEntity implements  Serializable{
	 
	
	 
 
	

 
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
 
	private java.lang.String name;
 
	private java.lang.String color;
	//columns END
 

	
	@Column(name = "name", unique = false, nullable = true, insertable = true, updatable = true, length = 255)
	public java.lang.String getName() {
		return this.name;
	}
	
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	@Column(name = "color", unique = false, nullable = true, insertable = true, updatable = true, length = 255)
	public java.lang.String getColor() {
		return this.color;
	}
	
	public void setColor(java.lang.String value) {
		this.color = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Name",getName())
			.append("Color",getColor())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof GtdTopic == false) return false;
		if(this == obj) return true;
		GtdTopic other = (GtdTopic)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

